From: Alex Williamson Date: Wed, 28 Nov 2007 19:32:28 +0000 (-0700) Subject: [IA64] vcpu_setcontext: only set cr_irr if VGCF_SET_CR_IRR flag is set. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14691 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=8d604f8b23d4575064d1e28ced673c6d4574058d;p=xen.git [IA64] vcpu_setcontext: only set cr_irr if VGCF_SET_CR_IRR flag is set. cr_irr can be modified even when a vcpu is blocked (by itv handler). Unconditionally setting cr_irr can trouble debugger as it may clear a bit of cr_irr and thus miss an interrupt. This can be very annoying if the interrupt is itv and the vcpu is inside PAL_HALT_LIGHT (the vcpu stays blocked forever). Signed-off-by: Tristan Gingold --- diff --git a/tools/libxc/ia64/xc_ia64_linux_restore.c b/tools/libxc/ia64/xc_ia64_linux_restore.c index 271a7297aa..528eef67e2 100644 --- a/tools/libxc/ia64/xc_ia64_linux_restore.c +++ b/tools/libxc/ia64/xc_ia64_linux_restore.c @@ -127,7 +127,7 @@ xc_ia64_recv_vcpu_context(int xc_handle, int io_fd, uint32_t dom, fprintf(stderr, "ip=%016lx, b0=%016lx\n", ctxt->regs.ip, ctxt->regs.b[0]); /* Initialize and set registers. */ - ctxt->flags = VGCF_EXTRA_REGS; + ctxt->flags = VGCF_EXTRA_REGS | VGCF_SET_CR_IRR; if (xc_vcpu_setcontext(xc_handle, dom, vcpu, ctxt) != 0) { ERROR("Couldn't set vcpu context"); return -1; diff --git a/xen/arch/ia64/vmx/vmx_vcpu_save.c b/xen/arch/ia64/vmx/vmx_vcpu_save.c index f435bddd1f..db55279c64 100644 --- a/xen/arch/ia64/vmx/vmx_vcpu_save.c +++ b/xen/arch/ia64/vmx/vmx_vcpu_save.c @@ -118,8 +118,8 @@ vmx_arch_set_info_guest(struct vcpu *v, vcpu_guest_context_u c) unsigned long vnat; unsigned long vbnat; - union vcpu_ar_regs *ar = &c.nat->regs.ar; - union vcpu_cr_regs *cr = &c.nat->regs.cr; + union vcpu_ar_regs *ar = &c.nat->regs.ar; + union vcpu_cr_regs *cr = &c.nat->regs.cr; int i; // banked registers @@ -177,13 +177,15 @@ vmx_arch_set_info_guest(struct vcpu *v, vcpu_guest_context_u c) vpd_low->iim = cr->iim; vpd_low->iha = cr->iha; vpd_low->lid = cr->lid; - vpd_low->ivr = cr->ivr; //XXX vlsapic vpd_low->tpr = cr->tpr; + vpd_low->ivr = cr->ivr; //XXX vlsapic vpd_low->eoi = cr->eoi; - vpd_low->irr[0] = cr->irr[0]; - vpd_low->irr[1] = cr->irr[1]; - vpd_low->irr[2] = cr->irr[2]; - vpd_low->irr[3] = cr->irr[3]; + if (c.nat->flags & VGCF_SET_CR_IRR) { + vpd_low->irr[0] = cr->irr[0]; + vpd_low->irr[1] = cr->irr[1]; + vpd_low->irr[2] = cr->irr[2]; + vpd_low->irr[3] = cr->irr[3]; + } vpd_low->itv = cr->itv; vpd_low->pmv = cr->pmv; vpd_low->cmcv = cr->cmcv; diff --git a/xen/include/public/arch-ia64.h b/xen/include/public/arch-ia64.h index 805f793d24..9fd63b1787 100644 --- a/xen/include/public/arch-ia64.h +++ b/xen/include/public/arch-ia64.h @@ -435,6 +435,7 @@ struct vcpu_guest_context_regs { struct vcpu_guest_context { #define VGCF_EXTRA_REGS (1UL << 1) /* Set extra regs. */ +#define VGCF_SET_CR_IRR (1UL << 2) /* Set cr_irr[0:3]. */ unsigned long flags; /* VGCF_* flags */ struct vcpu_guest_context_regs regs;